#include "common.h"

unsigned char ASC_To_Valu(unsigned char asc)
{
	uint8 valu = 0;

if (asc >= 0x30 && asc <= 0x39) {
    valu = asc - 0x30;
}

return valu;
}

void u32tostr(unsigned long dat, char *str)
{
    char temp[20]   = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
    unsigned char i = 0, j = 0;
    i = 0;
    while (dat) {
        temp[i] = dat % 10 + 0x30;
        i++;
        dat /= 10;
    }
    j = i;
    for (i = 0; i < j; i++) {
        str[i] = temp[j - i - 1];
    }
    str[i] = '\0';
}
